﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Contacts.Mail;

namespace Contacts
{
    public partial class Mess : Form
    {
        public string butresult { get { return _butresult; } }
        private string _butresult;
        string condition;
        
        public Mess(string condition)
        {            
            InitializeComponent();
            this.condition = condition; 
        }        

        private void Mess_Load(object sender, EventArgs e)
        {
            switch(condition)
            {
                case "par":
                    {
                        BackColor = Color.PaleGoldenrod;
                        Text = "Required & Preferred Fields Missing";
                        lab.Text = "Red colored fields required before form can be saved.\n\n" +
                                   "Green colored fields are highly recommended.\n\n";
                        no.Visible = false;
                        yes.Visible = false;
                        Location = new Point(450, 60);
                    }
                    break;

                case "r":
                    {
                        BackColor = Color.PaleGoldenrod;
                        Text = "Required Fields Missing";
                        lab.Text = "Red colored fields required before form can be saved.";
                        no.Visible = false;
                        yes.Visible = false;
                        Location = new Point(450, 60);
                    }
                    break;

                case "p":
                    {
                        BackColor = Color.PaleGoldenrod;
                        Text = "Preferred Fields Missing";
                        lab.Text = "Green colored fields are highly recommended.\n\n Do you wish to continue entering information?";
                        Location = new Point(450, 60);
                        ok.Visible = false;
                    }
                    break;
            }
        }

        public void but_ok_Click(object sender, EventArgs e)
        {
            _butresult = "ok";
            this.Close();
        }

        public void but_no_Click(object sender, EventArgs e)
        {
            _butresult = "no";
            this.Dispose();
        }

        public void but_stop_Click(object sender, EventArgs e)
        {
            _butresult = "yes";
            this.Close();
        }
    }
}
